package com.hmall.common.search;

import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Address;
import com.hmall.common.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Component
@FeignClient("itemservice")
public interface ItemClient {

    @GetMapping("/item/list")
    PageDTO<Item> list(@RequestParam("page") Integer page,
                       @RequestParam("size") Integer size);

    @RequestMapping("/item/{id}")
    Item findItemById(@PathVariable(value = "id")Long id);

    /**
     * 根据商品id减少对应库存
     * @param
     */
    @GetMapping("/item/xx/{id}")
    void updateItemNumById(@PathVariable(value = "id")Long orderId);
}
